home *** CD-ROM | disk | FTP | other *** search
- /*
- * ---------------------------------------------------------------------
- * CFinderEvent.h :
- *
- * Based on Jon Pugh Finder Event code
- *
- * © Copyright 1992 by F. Menneteau. All rights reserved.
- * This code can be both distributed and used freely.
- *
- * ---------------------------------------------------------------------
- */
-
-
- #pragma once
-
- #include "CGenericAE.h"
-
-
- // IM VI says: "[...] typically 200 to 300 bytes"
- #define MAX_ALIAS_SIZE 300
-
- /*
- * When an AliasRecord is created, it contains a visible fixed part, and
- * an invisible dynamic one (see IM VI for more information).
- *
- * When you declare an AliasRecord, the compiler only allocates room
- * for the visible part. So if you get an AliasRecord (after a call to
- * NewAlias for example), you cannot assign it directly to the alias
- * field of the FinderRecord. Thus, you need to allocate a buffer of size:
- * (**MyAlias).aliasSize - sizeof(aliasRecord), just after the structure.
- *
- * In order to avoid dynamic allocation, we use the following structure,
- * which is the concatenation of a FinderWindow and a buffer that emulates
- * the invisible dynamic part of the aliasRecord.
- *
- * Note that we use the !align_arrays pragma option to be sure fData is
- * just after the FinderWindow structure even if it is odd (which is at
- * present not the case).
- */
-
- #pragma options(!align_arrays)
-
- typedef struct {
- FinderWindow fFinderWindow ;
- char fData[MAX_ALIAS_SIZE] ;
- } FakeFinderWind ;
-
- #pragma options(align_arrays)
-
-
- class CFinderEvent : public CGenericAE {
- private:
- OSErr privFakeHideEventPutParam(OSType) ;
- OSErr privWindowPathPutParam(Ptr, WindowType);
- protected:
-
- public:
- OSErr IFinderEvent(void);
- OSErr IRemoteFinderEvent(Ptr);
-
- OSErr FESendAbout(void);
- OSErr FESendAliasSelection(Ptr, Ptr);
- OSErr FESendCloseAbout(void);
- OSErr FESendCloseWindow(Ptr, WindowType);
- OSErr FESendDragSelection(Ptr, Ptr, short, short);
- OSErr FESendDuplicateSelection(Ptr, Ptr);
- OSErr FESendEmptyTrash(void);
- OSErr FESendGetInfo(Ptr, Ptr);
- OSErr FESendHideClipboard(void);
- OSErr FESendMoveSelection(Ptr, Ptr, short, short);
- OSErr FESendMoveWindow(Ptr, short, short);
- OSErr FESendOpenSelection(Ptr, Ptr);
- OSErr FESendPageSetup(Ptr);
- OSErr FESendPrintSelection(Ptr, Ptr);
- OSErr FESendPrintWindow(Ptr);
- OSErr FESendPutAway(Ptr, Ptr);
- OSErr FESendResizeWindow(Ptr, short, short);
- OSErr FESendRestart(void);
- OSErr FESendRevealSelection(Ptr, Ptr);
- OSErr FESendSetView(Ptr, TypeWindowView);
- OSErr FESendSharing(Ptr, Ptr);
- OSErr FESendShowClipboard(void);
- OSErr FESendShutDown(void);
- OSErr FESendSleep(void);
- OSErr FESendZoomWindow(Ptr, TypeWindowZoom);
- } ;
-
-
-